Skip to content

h2 tests and deproxy h2 update #387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Feb 14, 2023
Merged

h2 tests and deproxy h2 update #387

merged 21 commits into from
Feb 14, 2023

Conversation

RomanBelozerov
Copy link
Contributor

@RomanBelozerov RomanBelozerov commented Jan 24, 2023

Now deproxy h2 client can:

  • send settings frame;
  • update default settings before create connection;
  • accept settings frame with ack flag;
  • wait settings frame with ack flag;
  • saves error codes;
  • send bytes;

handle_read method for deproxy h2 client - now method variable is created when client receives ResponseReceived event. This fixes error of receiving frames other than headers.

Added tests for issue #88:

Verification of correct frames exchange during establishing of h2 connection: get correct SETTINGS frame (with SETTINGS_INITIAL_WINDOW_SIZE parameter), correct WINDOW_UPDATE frame and correct SETTINGS ACK frame.

HPACK entries eviction: we must correctly process the maximum dynamic table and evict old entries - the test must define the table limit and send too many different headers

Use small SETTINGS_MAX_FRAME_SIZE on a client and test that HTTP response headers and body are normally fragmented

Stream IDs: (1) check that even IDs and ID > 0x7fffffff aren't accepted and (2) you cannot reuse old ID (see Victim 1–HTTP/2 Stream Multiplexing (CVE-2016-0150))

For all cases from issue #344

For issue #1394:

Doesn't send more than allowed by per-stream flow control

Added some tests for RFC 7541 and 9113.

Now client can:
- send settings frame;
- update default settings before create connection;
- accept settings frame with ack flag;
- wait settings frame with ack flag;

`handle_read` method for deproxy h2 client - now `method` variable is created when client receives `ResponseReceived` event. This fixes error of receiving frames other than headers.
…ERROR is received.

Deproxy is updated. Now client saves received error codes in list.
 - response is larger than SETTINGS_MAX_FRAME_SIZE.
 - request is larger than SETTINGS_MAX_FRAME_SIZE.
Copy link
Contributor

@const-t const-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -417,6 +427,80 @@ def make_request(self, request: tuple or list or str, end_stream=True, huffman=T
self.stream_id += 2
self.valid_req_num += 1

def update_initiate_settings(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe would be better to use name update_initial_settings instead of update_initiate_settings?

Comment on lines 396 to 397
if self.selfproxy_present:
self.update_selfproxy()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need it here?

renamed `update_initiate_settings` method, new name - `update_initial_settings`.
`handle_close` method was removed for case when client receives GOAWAY frame - client must not close connection, Tempesta does it
@RomanBelozerov RomanBelozerov merged commit 1c37a4f into master Feb 14, 2023
@RomanBelozerov RomanBelozerov deleted the rb-88-settings-frame branch February 14, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants